<?php
/**
 * Combined Policy Pages
 * Includes: Privacy Policy, Terms of Service, Cookie Policy
 */

session_start();
require_once 'config/database.php';
require_once 'includes/functions.php';

$type = $_GET['type'] ?? 'privacy';
$page_title = "Policies";

// Map type to title
$titles = [
    'privacy' => 'Privacy Policy',
    'terms' => 'Terms of Service',
    'cookie' => 'Cookie Policy',
    'shipping' => 'Shipping Information',
    'returns' => 'Returns Policy',
    'size-guide' => 'Size Guide'
];

$current_title = $titles[$type] ?? 'Privacy Policy';

include 'includes/header.php';
?>

<main style="padding: 2rem 0;">
    <div class="container">
        <nav style="display: flex; gap: 1rem; margin-bottom: 2rem; border-bottom: 2px solid #e0e0e0;">
            <a href="?type=privacy" style="padding: 1rem; text-decoration: none; <?php echo $type == 'privacy' ? 'border-bottom: 3px solid #e74c3c; color: #e74c3c;' : 'color: #666;'; ?>">Privacy</a>
            <a href="?type=terms" style="padding: 1rem; text-decoration: none; <?php echo $type == 'terms' ? 'border-bottom: 3px solid #e74c3c; color: #e74c3c;' : 'color: #666;'; ?>">Terms</a>
            <a href="?type=cookie" style="padding: 1rem; text-decoration: none; <?php echo $type == 'cookie' ? 'border-bottom: 3px solid #e74c3c; color: #e74c3c;' : 'color: #666;'; ?>">Cookies</a>
            <a href="?type=shipping" style="padding: 1rem; text-decoration: none; <?php echo $type == 'shipping' ? 'border-bottom: 3px solid #e74c3c; color: #e74c3c;' : 'color: #666;'; ?>">Shipping</a>
            <a href="?type=returns" style="padding: 1rem; text-decoration: none; <?php echo $type == 'returns' ? 'border-bottom: 3px solid #e74c3c; color: #e74c3c;' : 'color: #666;'; ?>">Returns</a>
            <a href="?type=size-guide" style="padding: 1rem; text-decoration: none; <?php echo $type == 'size-guide' ? 'border-bottom: 3px solid #e74c3c; color: #e74c3c;' : 'color: #666;'; ?>">Size Guide</a>
        </nav>

        <h1 style="margin-bottom: 2rem; color: #2c3e50;"><?php echo $current_title; ?></h1>
        
        <?php
        // Include appropriate content
        switch($type) {
            case 'privacy':
                include 'privacy-policy.php';
                break;
            case 'terms':
                include 'terms-of-service.php';
                break;
            case 'cookie':
                include 'cookie-policy.php';
                break;
            case 'shipping':
                include 'shipping.php';
                break;
            case 'returns':
                include 'returns.php';
                break;
            case 'size-guide':
                include 'size-guide.php';
                break;
            default:
                include 'privacy-policy.php';
        }
        ?>
    </div>
</main>

<?php include 'includes/footer.php'; ?>

